Skip to content

fix(core): decode URI template match values - #2732

Open
xianjianlf2 wants to merge 3 commits into
modelcontextprotocol:mainfrom
xianjianlf2:fix/uri-template-percent-decode
Open

fix(core): decode URI template match values#2732
xianjianlf2 wants to merge 3 commits into
modelcontextprotocol:mainfrom
xianjianlf2:fix/uri-template-percent-decode

Conversation

@xianjianlf2

Copy link
Copy Markdown

Summary

  • percent-decode values captured by UriTemplate.match()
  • decode exploded list elements independently while retaining encoded commas as data
  • preserve malformed percent-encoded values rather than throwing during matching

Tests

  • added regression coverage for decoded path/query/exploded values and malformed encodings
  • git diff --check
  • Prettier
  • direct TypeScript verification of the affected matcher

The package-level pnpm test command could not run in this environment because workspace dependency linking did not complete.

@changeset-bot

changeset-bot Bot commented Aug 27, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: fba3e1c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@modelcontextprotocol/core-internal Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Aug 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

@modelcontextprotocol/client

npm i https://pkg.pr.new/@modelcontextprotocol/client@2732

@modelcontextprotocol/codemod

npm i https://pkg.pr.new/@modelcontextprotocol/codemod@2732

@modelcontextprotocol/core

npm i https://pkg.pr.new/@modelcontextprotocol/core@2732

@modelcontextprotocol/server

npm i https://pkg.pr.new/@modelcontextprotocol/server@2732

@modelcontextprotocol/server-legacy

npm i https://pkg.pr.new/@modelcontextprotocol/server-legacy@2732

@modelcontextprotocol/express

npm i https://pkg.pr.new/@modelcontextprotocol/express@2732

@modelcontextprotocol/fastify

npm i https://pkg.pr.new/@modelcontextprotocol/fastify@2732

@modelcontextprotocol/hono

npm i https://pkg.pr.new/@modelcontextprotocol/hono@2732

@modelcontextprotocol/node

npm i https://pkg.pr.new/@modelcontextprotocol/node@2732

commit: fba3e1c

@xianjianlf2
xianjianlf2 marked this pull request as ready for review August 27, 2026 10:11
@xianjianlf2
xianjianlf2 requested a review from a team as a code owner August 27, 2026 10:11
@xianjianlf2

Copy link
Copy Markdown
Author

Updated the branch with the latest upstream/main to clear the BEHIND state.\n\nLocal validation:\n- pnpm install --frozen-lockfile\n- pnpm run build:all\n- pnpm run lint:all\n- pnpm -r typecheck\n- pnpm --filter @modelcontextprotocol/core-internal test -- uriTemplate.test.ts\n- git diff --check\n\nNote: pnpm run test:all completed all assertions but failed locally at the e2e package due to two unhandled 200ms request timeout rejections from scenarios/protocol.test.ts. The earlier GitHub CI e2e matrix was green, and this PR's direct uriTemplate test target passes after the base sync.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant